OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [asm-11/] [tests/] [test_0180_pst.mac] - Rev 40

Go to most recent revision | Compare with Previous | Blame | View Log

; $Id: test_0180_pst.mac 502 2013-04-02 19:29:30Z mueller $
;
; test interaction pst <-> lst
;
        .asect
        .blkw   400 

; defined constants based on opcodes

        c1 = inc                ;;!! 005200
        c2 = inc + 67           ;;!! 005267

; use opcode values as constants

        mov     #mov,r1         ;;!! 012701 010000
        mov     #inc,r2         ;;!! 012702 005200

; combine opcodes, especially cc ops
; uses implicit .word mechanism, and that pst symbols can be used as constants

        sec                     ;;!! 000261
        sev                     ;;!! 000262
        sez                     ;;!! 000264
        sen                     ;;!! 000270

        <sec!sev>               ;;!! 000263
        <sec!sev!sez>           ;;!! 000267
        <sec!sev!sez!sen>       ;;!! 000277
        
; Note: sec!sev without <> will not work, the first sec will trigger operand
;       parsing, and since sec doesn't have operands, flag an error

; using self-defined compound opcodes

        scv = sec ! sev         ;;!! 000263
        scv                     ;;!! 000263

; not check pst - lst interference
; opcodes are always looked-up from pst
; symbols are looked-up first in lst, than in pst

; opcode name defined as const
        cmp = 1234              ;;!! 001234

; instruction usage is unaltered, but usage as constant is redefined

        cmp     r0,r0           ;;!! 020000
        mov     #cmp,r0         ;;!! 012700 001234
        mov     #cmp+77,r0      ;;!! 012700 001333

; and label with an opcode name, same concept

        clr     r0              ;;!! 005000
        clr     @#mov           ;;!! 005037 010000
        clr     @#cmp           ;;!! 005037 001234
        clr     @#clr           ;;!! 005037 001060
clr:    clr     @#mov           ;;!! 001060: 005037 010000
        clr     @#cmp           ;;!! 005037 001234
        clr     @#clr           ;;!! 005037 001060

        .end

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.