add simple asm example
authorkbongers <kbongers@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 1 Sep 2001 16:33:30 +0000 (16:33 +0000)
committerkbongers <kbongers@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 1 Sep 2001 16:33:30 +0000 (16:33 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1204 4a8a32a2-be11-0410-ad9d-d568d2c75423

device/examples/mcs51/asmblink/Makefile [new file with mode: 0644]
device/examples/mcs51/asmblink/blink.asm [new file with mode: 0644]
device/examples/mcs51/asmblink/blink.lnk [new file with mode: 0644]
device/examples/mcs51/asmblink/go_dos.bat [new file with mode: 0644]

diff --git a/device/examples/mcs51/asmblink/Makefile b/device/examples/mcs51/asmblink/Makefile
new file mode 100644 (file)
index 0000000..94f8c84
--- /dev/null
@@ -0,0 +1,11 @@
+# makefile for Linux
+
+all : blink.ihx
+
+blink.ihx :
+       asx8051 -los blink.asm
+       aslink -f blink.lnk
+
+clean:
+       rm mon.ihx *.lst *.rel *.rst *.sym *.cdb *.map *.ihx
+
diff --git a/device/examples/mcs51/asmblink/blink.asm b/device/examples/mcs51/asmblink/blink.asm
new file mode 100644 (file)
index 0000000..b66093e
--- /dev/null
@@ -0,0 +1,34 @@
+;--------------------------------------------------------
+; blink.asm - simple ASM example to toggle a port pin
+;   (LED on TINI board).
+;
+;   On a TINI board this toggles really fast, so
+;   it appears that the LED just dims slightly.
+;   You may need a scope to detect it.
+;
+;  You can use s51(ucsim simulator) to look at the
+;  blink.ihx(hex-file).  Run like this:
+;  >S51 blink.ihx
+;  Then dump code like this:
+;  s51>dc
+;--------------------------------------------------------
+   .module bootasm
+
+;--------------------------------------------------------
+; Stack segment in internal ram 
+;--------------------------------------------------------
+       .area   SSEG    (DATA)
+__start__stack:
+       .ds     1
+
+       .area   CODE (CODE)
+       
+;--------------------------------------------------------
+; global & static initialisations
+;--------------------------------------------------------
+       .area GSINIT (CODE)
+main:
+   clr   ea    ; disable ints
+   clr   p3.5  ; turn LED off
+   setb  p3.5  ; turn LED on
+   ljmp  main
diff --git a/device/examples/mcs51/asmblink/blink.lnk b/device/examples/mcs51/asmblink/blink.lnk
new file mode 100644 (file)
index 0000000..ca16571
--- /dev/null
@@ -0,0 +1,10 @@
+-muxi
+-z
+-b CODE = 0x00000
+-b DSEG = 0x0030
+-b XSEG = 0x160000
+-b ISEG = 0x0080
+-b BSEG = 0x0000
+blink
+-e
+
diff --git a/device/examples/mcs51/asmblink/go_dos.bat b/device/examples/mcs51/asmblink/go_dos.bat
new file mode 100644 (file)
index 0000000..255de6a
--- /dev/null
@@ -0,0 +1,4 @@
+asx8051.exe -los blink.asm
+aslink -f blink.lnk
+
+