mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-15 08:02:48 +00:00
Very simple .LIST and .NLIST implementation.
Thanks to Don North. Also added a simple test. Fixes #3.
This commit is contained in:
parent
c771c875cb
commit
eb60cfe315
10
assemble.c
10
assemble.c
@ -277,12 +277,16 @@ static int assemble(
|
||||
case P_ENDR:
|
||||
case P_ENDM:
|
||||
case P_SBTTL:
|
||||
case P_LIST:
|
||||
case P_NLIST:
|
||||
case P_PRINT:
|
||||
return 1; /* Accepted, ignored. (An obvious
|
||||
need: get assembly listing
|
||||
controls working. ) */
|
||||
controls working fully. ) */
|
||||
case P_LIST:
|
||||
if (pass > 0) list_level++;
|
||||
return 1;
|
||||
case P_NLIST:
|
||||
if (pass > 0) list_level--;
|
||||
return 1;
|
||||
|
||||
case P_IDENT:
|
||||
{
|
||||
|
||||
@ -14,6 +14,7 @@ TESTS="test-asciz \
|
||||
test-impword \
|
||||
test-include \
|
||||
test-jmp \
|
||||
test-listing \
|
||||
test-locals \
|
||||
test-macro-comma \
|
||||
test-prec \
|
||||
|
||||
26
tests/test-listing.lst.ok
Normal file
26
tests/test-listing.lst.ok
Normal file
@ -0,0 +1,26 @@
|
||||
1 ;;;;;;
|
||||
2 ;
|
||||
3 ; Test the (so far very basic) .LIST and .NLIST directives.
|
||||
4 ;
|
||||
5
|
||||
6 ; This should get listed (list_level 1)
|
||||
7 .nlist
|
||||
10 ; This should get listed (list_level 1)
|
||||
11 .list
|
||||
12 ; This should get listed (list_level 2)
|
||||
13 .nlist
|
||||
14 ; This should get listed (list_level 1)
|
||||
15 .nlist
|
||||
22 ; This should get listed (list_level 1)
|
||||
22
|
||||
|
||||
|
||||
Symbol table
|
||||
|
||||
. ******R 001
|
||||
|
||||
|
||||
Program sections:
|
||||
|
||||
. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV)
|
||||
000000 001 (RW,I,LCL,REL,CON,NOSAV)
|
||||
22
tests/test-listing.mac
Normal file
22
tests/test-listing.mac
Normal file
@ -0,0 +1,22 @@
|
||||
;;;;;;
|
||||
;
|
||||
; Test the (so far very basic) .LIST and .NLIST directives.
|
||||
;
|
||||
|
||||
; This should get listed (list_level 1)
|
||||
.nlist
|
||||
; This should NOT get listed (list_level 0)
|
||||
.list
|
||||
; This should get listed (list_level 1)
|
||||
.list
|
||||
; This should get listed (list_level 2)
|
||||
.nlist
|
||||
; This should get listed (list_level 1)
|
||||
.nlist
|
||||
; This should NOT get listed (list_level 0)
|
||||
.nlist
|
||||
; This should NOT get listed (list_level -1)
|
||||
.list
|
||||
; This should NOT get listed (list_level 0)
|
||||
.list
|
||||
; This should get listed (list_level 1)
|
||||
Loading…
x
Reference in New Issue
Block a user