\r
; macros to PUSH and POP multiple registers\r
\r
-PUSHx MACRO R1, R2, R3, R4, R5, R6, R7, R8\r
- IFNB <R1>\r
- push R1 ; Save R1\r
- PUSHx R2, R3, R4, R5, R6, R7, R8\r
- ENDIF\r
-ENDM\r
-\r
-POPx MACRO R1, R2, R3, R4, R5, R6, R7, R8\r
- IFNB <R1>\r
- pop R1 ; Restore R1\r
- POPx R2, R3, R4, R5, R6, R7, R8\r
- ENDIF\r
-ENDM\r
+; PUSHx MACRO R1, R2, R3, R4;, R5, R6, R7, R8\r
+; IFNB <R1>\r
+; push R1 ; Save R1\r
+; PUSHx R2, R3, R4;, R5, R6, R7, R8\r
+; ENDIF\r
+; ENDM\r
+;\r
+; POPx MACRO R1, R2, R3, R4;, R5, R6, R7, R8\r
+; IFNB <R1>\r
+; pop R1 ; Restore R1\r
+; POPx R2, R3, R4;, R5, R6, R7, R8\r
+; ENDIF\r
+; ENDM\r
\r
; Macro to Clear a Register to 0\r
\r
\r
DOS_PRINT PROC FAR\r
\r
- PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ ;PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ push bp\r
+ push ds\r
+ push si\r
+ push di\r
mov BP, SP ; Set up Stack Frame\r
\r
lds DX, [BP].DP_Text ; Get Addr of Text$ descriptor\r
int 21h ; Call DOS to do it\r
\r
cld ; Reset Direction Flag\r
- POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ ;POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ pop di\r
+ pop si\r
+ pop ds\r
+ pop bp\r
ret 4 ; Exit & Clean Up Stack\r
\r
DOS_PRINT ENDP\r
\r
DOS_PRINTS PROC FAR\r
\r
- PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ ;PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ push bp\r
+ push ds\r
+ push si\r
+ push di\r
mov BP, SP ; Set up Stack Frame\r
\r
lds DX, [BP].DP_Text ; Get Addr of Text$ descriptor\r
\r
@DPS_Exit:\r
cld ; Reset Direction Flag\r
- POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ ;POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ pop di\r
+ pop si\r
+ pop ds\r
+ pop bp\r
ret 2 ; Exit & Clean Up Stack\r
\r
DOS_PRINTS ENDP\r
\r
SET_VIDEO_MODE PROC FAR\r
\r
- PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ ;PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ push bp\r
+ push ds\r
+ push si\r
+ push di\r
mov BP, SP ; Set up Stack Frame\r
\r
CLR AH ; Function 0\r
int 10H ; Change Video Modes\r
\r
@SVM_Exit:\r
- POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ ;POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ pop di\r
+ pop si\r
+ pop ds\r
+ pop bp\r
ret 2 ; Exit & Clean Up Stack\r
\r
SET_VIDEO_MODE ENDP\r
\r
SCAN_KEYBOARD PROC FAR\r
\r
- PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ ;PUSHx BP, DS, SI, DI ; Preserve Important Registers\r
+ push bp\r
+ push ds\r
+ push si\r
+ push di\r
\r
mov AH, 01H ; Function #1\r
INT 16H ; Call Keyboard Driver\r
\r
@SK_Exit:\r
cld ; Reset Direction Flag\r
- POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ ;POPx DI, SI, DS, BP ; Restore Saved Registers\r
+ pop di\r
+ pop si\r
+ pop ds\r
+ pop bp\r
ret ; Exit & Clean Up Stack\r
\r
SCAN_KEYBOARD ENDP\r
\r
INT_SQR PROC FAR\r
\r
- PUSHx BP, DI ; Save BP\r
+ ;PUSHx BP, DI ; Save BP\r
+ push bp\r
+ push di\r
mov BP, SP ; Set up Stack Frame\r
\r
xor AX, AX ; {xor eax,eax}\r
\r
add ax, [BP].ISQ_Round ; {add eax,$00008000}\r
; {*round* result in hi word: ie. +0.5}\r
- shr ax, 8 ; {shr eax,16} {to ax (result)}\r
-\r
- POPx DI, BP ; Restore Registers\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+ shr ax, 1 ; {shr eax,16} {to ax (result)}\r
+\r
+ ;POPx DI, BP ; Restore Registers\r
+ pop di\r
+ pop bp\r
ret 4 ; Exit\r
\r
INT_SQR ENDP\r