Category : BASIC Source Code
Archive   : UBAS830.ZIP
Filename : UB.MAC

 
Output of file : UB.MAC contained in archive : UBAS830.ZIP
;UB.MAC
; MACRO LIBRARY FOR
; UBASIC USER MAKING ROUTINE
;

SYSTBL EQU 0000H

LSIZE EQU 0040H ;”z—ñ’·•Ï”‚Ì BYTE ”‚ª‘‚¢‚Ä‚ ‚é
LLSIZE EQU 0042H ;”z—ñ“Á•Ê•Ï”‚Ì BYTE ”‚ª‘‚¢‚Ä‚ ‚é
CALCSP EQU 0044H ;ŒvŽZƒXƒ^ƒbƒN‚̃|ƒCƒ“ƒ^‚ª‚ ‚é
POINT EQU 0046H ;POINT
ARRAYHEADSEG EQU 2 ;”z—ñ‚ÌHEADER•ª‚ÌSEGMENT

;bit masks for attribute word

attribmask equ 0111110000000000b
attribmaskhigh equ 01111100b
lenmask equ 0000001111111111b
lenmaskhigh equ 00000011b
pointmask equ 0100000000000000b
pointmaskhigh equ 01000000b
complexmask equ 0010000000000000b
complexmaskhigh equ 00100000b
ratmask equ 0001000000000000b
ratmaskhigh equ 00010000b
stringmask equ 0000100000000000b
stringmaskhigh equ 00001000b
packmask equ 0000010000000000b
packmaskhigh equ 00000100b
polymask equ 0000110000000000b
polymaskhigh equ 00001100b
modpolymask equ 0001100000000000b
modpolymaskhigh equ 00011000b

; parameter address

V1 EQU 0080H
V2 EQU 0084H
V3 EQU 0088H
V4 EQU 008CH
V5 EQU 0090H
V6 EQU 0094H
V7 EQU 0098H
V8 EQU 009CH
V9 EQU 00A0H
V10 EQU 00A4H
V11 EQU 00A8H
V12 EQU 00ACH
V13 EQU 00B0H
V14 EQU 00B4H
V15 EQU 00B8H
V16 EQU 00BCH

V17 EQU 00C0H
V18 EQU 00C4H
V19 EQU 00C8H
V20 EQU 00CCH
V21 EQU 00D0H
V22 EQU 00D4H
V23 EQU 00D8H
V24 EQU 00DCH
V25 EQU 00E0H
V26 EQU 00E4H
V27 EQU 00E8H
V28 EQU 00ECH
V29 EQU 00F0H
V30 EQU 00F4H
V31 EQU 00F8H
V32 EQU 00FCH

AR0 EQU 0020H
AR1 EQU 0022H
AR2 EQU 0024H
AR3 EQU 0026H
AR4 EQU 0028H
AR5 EQU 002AH
AR6 EQU 002CH
AR7 EQU 002EH

;FUNCTION CODE

SGN EQU 1
LEN EQU 2
BIT EQU 3
GCD EQU 4
SQR EQU 5
ISQR EQU 6
FIX EQU 7
KRO EQU 8
SIN EQU 9
COS EQU 10

EXP EQU 11
LOG EQU 12
PAI EQU 13
PRM EQU 14
MOB EQU 15
EUL EQU 16
PRMDIV EQU 17

MODPOW EQU 26
MODINV EQU 27
INT EQU 28
ALEN EQU 29
NXTPRM EQU 30

MAX EQU 31
MIN EQU 32
SFT EQU 33


MOV_AX MACRO PARAM
DB 2EH ;CS:
DB 0A1H ;MOV AX,[PARAM]
DW PARAM
ENDM

MOV_BX MACRO PARAM
DB 2EH ;CS:
DB 8BH ;MOV BX,[PARAM]
DB 1EH
DW PARAM
ENDM

LDS_SI MACRO PARAM
DB 2EH ;CS:
DB 0C5H,36H
DW PARAM
ENDM

LES_DI MACRO PARAM
DB 2EH ;CS:
DB 0C4H,3EH
DW PARAM
ENDM

CALL_F MACRO PARAM
DB 36H ;SS:
DB 0FFH,1EH
DW PARAM
ENDM



@LET MACRO DEST,SORC
LDS_SI SORC
LES_DI DEST
MOV CX,[SI]
AND CX,lenmask
INC CX
CLD
REP MOVSW
ENDM


@PUSH MACRO SORC
LDS_SI SORC
CALL_F SYSTBL+4
ENDM


@POP MACRO DEST
LES_DI DEST
CALL_F SYSTBL+8
ENDM


@ADD MACRO
CALL_F SYSTBL+32 ;8*4
ENDM


@SUB MACRO
CALL_F SYSTBL+36 ;9*4
ENDM


@MUL MACRO
CALL_F SYSTBL+40 ;10*4
ENDM


@DIV MACRO
CALL_F SYSTBL+44 ;11*4
ENDM


@IDIV MACRO
CALL_F SYSTBL+48 ;12*4
ENDM


@MOD MACRO
CALL_F SYSTBL+52 ;13*4
ENDM


@P2 MACRO
CALL_F SYSTBL+56 ;14*4
ENDM


@FUNC MACRO FUNCNAME
MOV AX,SS
MOV DS,AX
MOV ES,AX
MOV AL,FUNCNAME
CALL_F SYSTBL
ENDM

@DUMPUSH MACRO
MOV_BX CALCSP
MOV_AX LLSIZE
SUB SS:[BX],AX
ENDM

@DUMPOP MACRO
MOV_BX CALCSP
MOV_AX LLSIZE
ADD SS:[BX],AX
ENDM


RETF MACRO
DB 0CBH
ENDM


RETURN MACRO
MOV AX,SS
MOV DS,AX
MOV ES,AX
RETF ;DB 0CBH

CODE ENDS
END START

ENDM


JMPS MACRO DEST
JMP SHORT DEST
ENDM

JMPE MACRO DEST
LOCAL LAB
JNE LAB
JMP DEST
LAB:
ENDM


.LIST

CODE SEGMENT
ASSUME CS:CODE,DS:CODE

ORG 100H
START:



  3 Responses to “Category : BASIC Source Code
Archive   : UBAS830.ZIP
Filename : UB.MAC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/