; $Id: test_0180_pst.mac 502 2013-04-02 19:29:30Z mueller $
|
; $Id: test_0180_pst.mac 502 2013-04-02 19:29:30Z mueller $
|
;
|
;
|
; test interaction pst <-> lst
|
; test interaction pst <-> lst
|
;
|
;
|
.asect
|
.asect
|
.blkw 400
|
.blkw 400
|
|
|
; defined constants based on opcodes
|
; defined constants based on opcodes
|
|
|
c1 = inc ;;!! 005200
|
c1 = inc ;;!! 005200
|
c2 = inc + 67 ;;!! 005267
|
c2 = inc + 67 ;;!! 005267
|
|
|
; use opcode values as constants
|
; use opcode values as constants
|
|
|
mov #mov,r1 ;;!! 012701 010000
|
mov #mov,r1 ;;!! 012701 010000
|
mov #inc,r2 ;;!! 012702 005200
|
mov #inc,r2 ;;!! 012702 005200
|
|
|
; combine opcodes, especially cc ops
|
; combine opcodes, especially cc ops
|
; uses implicit .word mechanism, and that pst symbols can be used as constants
|
; uses implicit .word mechanism, and that pst symbols can be used as constants
|
|
|
sec ;;!! 000261
|
sec ;;!! 000261
|
sev ;;!! 000262
|
sev ;;!! 000262
|
sez ;;!! 000264
|
sez ;;!! 000264
|
sen ;;!! 000270
|
sen ;;!! 000270
|
|
|
;;!! 000263
|
;;!! 000263
|
;;!! 000267
|
;;!! 000267
|
;;!! 000277
|
;;!! 000277
|
|
|
; Note: sec!sev without <> will not work, the first sec will trigger operand
|
; Note: sec!sev without <> will not work, the first sec will trigger operand
|
; parsing, and since sec doesn't have operands, flag an error
|
; parsing, and since sec doesn't have operands, flag an error
|
|
|
; using self-defined compound opcodes
|
; using self-defined compound opcodes
|
|
|
scv = sec ! sev ;;!! 000263
|
scv = sec ! sev ;;!! 000263
|
scv ;;!! 000263
|
scv ;;!! 000263
|
|
|
; not check pst - lst interference
|
; not check pst - lst interference
|
; opcodes are always looked-up from pst
|
; opcodes are always looked-up from pst
|
; symbols are looked-up first in lst, than in pst
|
; symbols are looked-up first in lst, than in pst
|
|
|
; opcode name defined as const
|
; opcode name defined as const
|
cmp = 1234 ;;!! 001234
|
cmp = 1234 ;;!! 001234
|
|
|
; instruction usage is unaltered, but usage as constant is redefined
|
; instruction usage is unaltered, but usage as constant is redefined
|
|
|
cmp r0,r0 ;;!! 020000
|
cmp r0,r0 ;;!! 020000
|
mov #cmp,r0 ;;!! 012700 001234
|
mov #cmp,r0 ;;!! 012700 001234
|
mov #cmp+77,r0 ;;!! 012700 001333
|
mov #cmp+77,r0 ;;!! 012700 001333
|
|
|
; and label with an opcode name, same concept
|
; and label with an opcode name, same concept
|
|
|
clr r0 ;;!! 005000
|
clr r0 ;;!! 005000
|
clr @#mov ;;!! 005037 010000
|
clr @#mov ;;!! 005037 010000
|
clr @#cmp ;;!! 005037 001234
|
clr @#cmp ;;!! 005037 001234
|
clr @#clr ;;!! 005037 001060
|
clr @#clr ;;!! 005037 001060
|
clr: clr @#mov ;;!! 001060: 005037 010000
|
clr: clr @#mov ;;!! 001060: 005037 010000
|
clr @#cmp ;;!! 005037 001234
|
clr @#cmp ;;!! 005037 001234
|
clr @#clr ;;!! 005037 001060
|
clr @#clr ;;!! 005037 001060
|
|
|
.end
|
.end
|
|
|