diff options
Diffstat (limited to 'v4.0/src/MAPPER/SCURPOS.ASM')
| -rw-r--r-- | v4.0/src/MAPPER/SCURPOS.ASM | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/SCURPOS.ASM b/v4.0/src/MAPPER/SCURPOS.ASM new file mode 100644 index 0000000..e7af7a6 --- /dev/null +++ b/v4.0/src/MAPPER/SCURPOS.ASM | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | ; | ||
| 2 | page 60,132 | ||
| 3 | ; | ||
| 4 | title CP/DOS VioSetCurPos mapper | ||
| 5 | ; | ||
| 6 | vioxxx segment byte public 'vio' | ||
| 7 | assume cs:vioxxx,ds:nothing,es:nothing,ss:nothing | ||
| 8 | ; | ||
| 9 | ; ************************************************************************* * | ||
| 10 | ; * | ||
| 11 | ; * MODULE: viosetcurpos | ||
| 12 | ; * | ||
| 13 | ; * FILE NAME: scurpos.asm | ||
| 14 | ; * | ||
| 15 | ; * CALLING SEQUENCE: | ||
| 16 | ; * | ||
| 17 | ; * push word row value | ||
| 18 | ; * push word column value | ||
| 19 | ; * push word vio handle | ||
| 20 | ; * call viosetcurpos | ||
| 21 | ; * | ||
| 22 | ; * | ||
| 23 | ; * MODULES CALLED: BIOS Int 10h | ||
| 24 | ; * | ||
| 25 | ; ************************************************************************* | ||
| 26 | |||
| 27 | public viosetcurpos | ||
| 28 | .sall | ||
| 29 | .xlist | ||
| 30 | include macros.inc | ||
| 31 | .list | ||
| 32 | |||
| 33 | error_bvs_parameter equ 0002h | ||
| 34 | |||
| 35 | str struc | ||
| 36 | old_bp dw ? | ||
| 37 | return dd ? | ||
| 38 | handle dw ? ; vio handle | ||
| 39 | column dw ? ; column value | ||
| 40 | row dw ? ; row value | ||
| 41 | str ends | ||
| 42 | |||
| 43 | viosetcurpos proc far | ||
| 44 | Enter viosetcurpos ; push registers | ||
| 45 | |||
| 46 | mov bh,0 | ||
| 47 | mov ax,[bp].row ; get column number | ||
| 48 | cmp al,25 ; compare with maximum size allowed | ||
| 49 | jg error ; branch if illegal size | ||
| 50 | mov dh,al ; load row in dh | ||
| 51 | |||
| 52 | mov ax,[bp].column ; get column number | ||
| 53 | cmp al,80 ; check for upper boundry | ||
| 54 | jg error ; branch if illegal size | ||
| 55 | mov dl,al ; load column in dl | ||
| 56 | |||
| 57 | mov ah,02 ; set BIOS function code | ||
| 58 | pushal ; Save registers in case int 10h | ||
| 59 | ; messes them up | ||
| 60 | int 10h ; set cursor position | ||
| 61 | popal | ||
| 62 | |||
| 63 | sub ax,ax ; set good return code | ||
| 64 | jmp exit ; return | ||
| 65 | |||
| 66 | error: mov ax,error_bvs_parameter ; set error return code | ||
| 67 | exit: Mexit ; pop registers | ||
| 68 | ret size str - 6 ; return | ||
| 69 | |||
| 70 | viosetcurpos endp | ||
| 71 | vioxxx ends | ||
| 72 | end | ||