home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
131_01
/
test1.csm
< prev
next >
Wrap
Text File
|
1985-03-10
|
2KB
|
86 lines
;CRL Assembler Test File
;
;Pseudo ops and expression evaluation
;equ test
zero equ 0 ;define a symbol
null equ zero ;referance it
;set test
foo set 1 ;redefinable symbol
foo set 2 ;redefine it
;Test Number conversion
b2 equ 10b ;binary
b8 equ 10q ;octal
b9 equ 10o ; "
b10 equ 10 ;decimal
b11 equ 10d ; "
b16 equ 10h ;hex
;Test Expression Evaluation
u1 equ -4 ;unary -
u2 equ NOT 1 ;not
u3 equ HIGH 1234h ;high
u4 equ LOW 1234h ;low
x1 equ 2+2 ;addition
x2 equ 3-2 ;subtraction
x3 equ 2*3 ;multiplication
x4 equ 8/2 ;division
x5 equ 10 MOD 4 ;mod
x6 equ 1 SHL 3 ;shift left
x7 equ 80h SHR 4 ;shift right
x8 equ 0FFh AND 5 ;and
x9 equ 1 OR 2 ;or
x10 equ 5 XOR 4 ;xor
p1 equ 2*(1+3) ;parentheses
;Function Definition
func1 FUNCTION extrn1, extrn2
loc1 equ zero ;local symbol definition
;referancing a global symbol
loc2 set 0 ;local set absolute
loc2 set $ ;redefined relocatable
foo set 3 ;redefine global set
;db test
db 1,2,3+4 ;bytes
db 'string',0 ;mixed
db 'A'+20h ;char expression
;dw test (and $)
dw 2+4 ;absolute expression
dw $ ;relocatable expression
dw extrn1 ;external function referance
dw 1,2,3 ;multiple values
ds 5 ;ds test
label: dw label ;label definition
;Mixed type expressions
dw $+1 ;rel + abs
dw $-1 ;rel - abs
dw 1+$ ;abs + rel
dw $-$ ;rel - rel
FEND
;Test for unique locals
func2 FUNCTION
loc1 equ 1 ;unique from prev function
dw foo ;'set' value redefined in func1
FEND
end