Skip to content

Commit

Permalink
Merge pull request #7 from fourstix/b_asm_02_update
Browse files Browse the repository at this point in the history
Updated files for Kernel 4 and Asm/02 Assembler
  • Loading branch information
fourstix authored Aug 21, 2021
2 parents 7c15c95 + 4aa08a9 commit b667050
Show file tree
Hide file tree
Showing 67 changed files with 233 additions and 192 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Elfos-utils
A set of simple utility commands for the Elf/OS. These commands were all assembled into Intel hex files using the
[RcAsm 1802 Assembler](https://github.com/rileym65/RcAsm) by Mike Riley. The hex files were converted into binary files using
[hex2bin](https://sourceforge.net/projects/hex2bin/) for Windows.
A set of simple utility commands for the Elf/OS. These commands were all assembled into 1802 binary files using the
[Asm/02 1802 Assembler](https://github.com/rileym65/Asm-02) by Mike Riley.

Platform
--------
Expand Down Expand Up @@ -112,7 +111,7 @@ Repository Contents
* cmd.asm - Run commands from a file.
* cls.asm - Clear the screen
* MemoryHog.asm - Allocate block of memory from heap for testing.
* make_xxx.bat - Windows batch file to assemble xxx.asm and create binary
* asm.bat - Windows batch file to assemble source file with Asm/02 to create binary file. Use the command *asm xxx.asm* to assemble the xxx.asm file.
* bios.inc - Bios definitions from Elf/OS
* kernel.inc - Kernel definitions from Elf/OS
* **/src/stg/** -- Source files for STG NVR/RTC/UART and STG EPROM utilities.
Expand All @@ -121,15 +120,15 @@ Repository Contents
* xsb.asm - XMODEM Send using the STG Expansion card UART
* seq.asm - Set Q. (The Q bit is available when using the STG Expansion card UART)
* req.asm - Reset Q. (The Q bit is available when using the STG Expansion card UART)
* make_xxx.bat - Windows batch file to assemble xxx.asm and create binary
* asm.bat - Windows batch file to assemble source file with Asm/02 to create binary file. Use the command *asm xxx.asm* to assemble the xxx.asm file.
* bios.inc - Bios definitions from Elf/OS
* kernel.inc - Kernel definitions from Elf/OS
* **/src/video/** -- Source files for 1861 Pixie Video utilities and demo programs
* spaceship - Joseph A Weisbecker's Pixie Graphic Demo program (Press Input /EF4 to exit)
* dma_test -Tom Pittman's Video DMA program (Press Input /EF4 to exit)
* tvclock - Tom Pittman's TV Clock Demo program (Press Input /EF4 to exit)
* voff - Turn 1861 Pixie Video Off (OUT 1 and disable interrupts)
* make_xxx.bat - Windows batch file to assemble xxx.asm and create binary
* asm.bat - Windows batch file to assemble source file with Asm/02 to create binary file. Use the command *asm xxx.asm* to assemble the xxx.asm file.
* bios.inc - Bios definitions from Elf/OS
* kernel.inc - Kernel definitions from Elf/OS
* **/bin/** -- Binary files for miscellaneous Elf/OS utilities.
Expand Down Expand Up @@ -158,14 +157,11 @@ Repository Contents
Elf/OS
Copyright (c) 2004-2021 by Mike Riley

RcAsm 1802 Assembler
Asm/02 1802 Assembler
Copyright (c) 2004-2021 by Mike Riley

Elf/OS Init Program
Copyright (c) 2021 by David Madole

Hex2bin
Copyright (C) 1998-2021 by Jacques Pelletier

The Pico/Elf Microcomputer Hardware
Copyright (c) 2020-2021 by Mike Riley
Expand Down
Binary file modified bin/MemoryHog.bin
Binary file not shown.
Binary file modified bin/cls.bin
Binary file not shown.
Binary file modified bin/cmd.bin
Binary file not shown.
Binary file modified bin/input.bin
Binary file not shown.
Binary file modified bin/nop.bin
Binary file not shown.
Binary file modified bin/output.bin
Binary file not shown.
Binary file modified bin/pwd.bin
Binary file not shown.
Binary file modified bin/say.bin
Binary file not shown.
Binary file modified bin/stack.bin
Binary file not shown.
Binary file modified bin/stg/req.bin
Binary file not shown.
Binary file modified bin/stg/seq.bin
Binary file not shown.
Binary file modified bin/stg/stg.bin
Binary file not shown.
Binary file modified bin/stg/visualstg.bin
Binary file not shown.
Binary file modified bin/stg/xsb.bin
Binary file not shown.
Binary file modified bin/video/dma_test.bin
Binary file not shown.
Binary file modified bin/video/spaceship.bin
Binary file not shown.
Binary file modified bin/video/tvclock.bin
Binary file not shown.
Binary file modified bin/video/voff.bin
Binary file not shown.
Binary file modified lbr/misc_utils.lbr
Binary file not shown.
Binary file modified lbr/stg_utils.lbr
Binary file not shown.
Binary file modified lbr/video_utils.lbr
Binary file not shown.
7 changes: 3 additions & 4 deletions src/MemoryHog.asm
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
; *******************************************************************************************
; MemoryHog - Allocate a block of memory on the heap for testing low memory conditions.
;
; Copyright (c) 2021 by Gaston Williams
;
; *******************************************************************************************

include bios.inc
include kernel.inc
Expand All @@ -21,7 +20,7 @@ include kernel.inc

; Build information
binfo: db 80H+8 ; Month, 80H offset means extended info
db 18 ; Day
db 21 ; Day
dw 2021 ; Year

; Current build number
Expand Down Expand Up @@ -52,7 +51,7 @@ good: ghi ra ; copy argument address to rf
sep scall ; convert input to integer value
dw f_atoi

start: ghi rd ; RD contains the block size in bytes
ghi rd ; RD contains the block size in bytes
phi rc ; Move size into RC for allocate
glo rd
plo rc ; load block size
Expand Down
2 changes: 0 additions & 2 deletions src/MemoryHog.bat

This file was deleted.

1 change: 1 addition & 0 deletions src/asm.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Your Path]\Asm02\asm02 -b -l -pev2 %1
38 changes: 18 additions & 20 deletions src/bios.inc
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,21 @@ f_version: equ (BIOS+0f9h) ; 3 bytes holding bios version number

; "Extended" BIOS vectors

f_bread equ (EBIOS+00h) ; read from onboard serial port
f_btype equ (EBIOS+03h) ; write to onboard serial port
f_btest equ (EBIOS+06h) ; test onboard serial port
f_utype equ (EBIOS+09h) ; write to disk board UART
f_uread equ (EBIOS+0ch) ; read from disk board UART
f_utest equ (EBIOS+0fh) ; test disk board UART
f_usetbd equ (EBIOS+12h) ; set disk board UART baud rate and format
f_gettod equ (EBIOS+15h) ; read time of day clock
f_settod equ (EBIOS+18h) ; set time of day clock
f_rdnvr equ (EBIOS+1bh) ; read non volatile RAM
f_wrnvr equ (EBIOS+1eh) ; write non volatile RAM
f_idesize equ (EBIOS+21h) ; return size of attached IDE drive(s)
f_ideid equ (EBIOS+24h) ; return device data for IDE drive(s)
f_tmtoas equ (EBIOS+2ah) ; time to ASCII string
f_dttoas equ (EBIOS+27h) ; date to ASCII string
f_rtctest equ (EBIOS+2dh) ; test size and presence of RTC/NVR
f_astodt equ (EBIOS+30h) ; convert ASCII string to date
f_astotm equ (EBIOS+33h) ; convert ASCII string to time


f_bread: equ (EBIOS+00h) ; read from onboard serial port
f_btype: equ (EBIOS+03h) ; write to onboard serial port
f_btest: equ (EBIOS+06h) ; test onboard serial port
f_utype: equ (EBIOS+09h) ; write to disk board UART
f_uread: equ (EBIOS+0ch) ; read from disk board UART
f_utest: equ (EBIOS+0fh) ; test disk board UART
f_usetbd: equ (EBIOS+12h) ; set disk board UART baud rate and format
f_gettod: equ (EBIOS+15h) ; read time of day clock
f_settod: equ (EBIOS+18h) ; set time of day clock
f_rdnvr: equ (EBIOS+1bh) ; read non volatile RAM
f_wrnvr: equ (EBIOS+1eh) ; write non volatile RAM
f_idesize: equ (EBIOS+21h) ; return size of attached IDE drive(s)
f_ideid: equ (EBIOS+24h) ; return device data for IDE drive(s)
f_tmtoas: equ (EBIOS+2ah) ; time to ASCII string
f_dttoas: equ (EBIOS+27h) ; date to ASCII string
f_rtctest: equ (EBIOS+2dh) ; test size and presence of RTC/NVR
f_astodt: equ (EBIOS+30h) ; convert ASCII string to date
f_astotm: equ (EBIOS+33h) ; convert ASCII string to time
2 changes: 1 addition & 1 deletion src/cls.asm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include kernel.inc
br start ; Jump past build information
; Build date
date: db 80H+8 ; Month 80H offset means extended info
db 16 ; Day
db 21 ; Day
dw 2021 ; Year

; Current build number
Expand Down
12 changes: 6 additions & 6 deletions src/cmd.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@


; Include bios ad kernel API
include bios.inc
include kernel.inc
include bios.inc
include kernel.inc

; Define internal kernel AP
d_reapheap equ 044dh
d_progend equ 0450h
d_lowmem equ 0465h
d_reapheap: equ 044dh
d_progend: equ 0450h
d_lowmem: equ 0465h

; Program header to start at $5000

Expand All @@ -37,7 +37,7 @@ start: org 5000h
; Build information

db 8+80h ; month
db 18 ; day
db 21 ; day
dw 2021 ; year
dw 4 ; build
text: db 'Copyright 2021 Gaston Williams',0
Expand Down
3 changes: 2 additions & 1 deletion src/input.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; -------------------------------------------------------------------
; Input a data byte from port 4
; Copyright 2021 by Gaston Williams
; -------------------------------------------------------------------
; Based on software written by Michael H Riley
; Thanks to the author for making this code available.
Expand Down Expand Up @@ -30,7 +31,7 @@ include kernel.inc

; Build date
date: db 80H+8 ; Month, 80H offset means extended info
db 7 ; Day
db 21 ; Day
dw 2021 ; Year

; Current build number
Expand Down
35 changes: 35 additions & 0 deletions src/kernel.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,39 @@ O_EXECBIN: equ 0342h ; execute from default directory
O_SETDEF: equ 0345h ; set/get default directory
O_KINIT: equ 0348h ; reserved - do not use!!!
O_INMSG: equ 034bh ; passthrough for console output
O_GETDEV: equ 034eh ; passthrough to f_getdef
O_GETTOD: equ 0351h ; passthrough to f_gettod
O_SETTOD: equ 0354h ; passthrough to f_settod
O_INPUTL: equ 0357h ; passthrough to f_inputl
O_BOOT: equ 035ah ; passthrough to f_boot
O_SETBD: equ 0360h ; passthrough to f_setbd
O_INITCALL: equ 0363h ; passthrough to f_initcall
O_BRKTEST: equ 0366h ; passthrough to f_brktest
O_DEVCTRL: equ 0369h ; Hook for device control drivers
O_ALLOC: equ 036ch ; passthrough to alloc
O_DEALLOC: equ 036fh ; passthrough to dealloc
O_TERMCTRL: equ 0372h ; Hook for terminal control drivers
O_MEMCTRL: equ 0375h ; Hook for memory control drivers
I_SERVE: equ 03f6h ; address of interrupt chain head
V_IVEC: equ 03fdh ; interrupt head
V_DVEC: equ 036ah ; device head
K_VER: equ 0400h ; kernel version number
K_BUILD: equ 0403h ; kernel build number
K_BMONTH: equ 0405h ; kernel build month
K_BDAY: equ 0406h ; kernel build day
K_BYEAR: equ 0407h ; kernel build month
K_HIMEM: equ 0442h ; high memory pointer
K_LOWMEM: equ 0465h ; lowest memory heap can use
K_RETVAL: equ 0467h ; D on program exit
K_HEAP: equ 0468h ; heap pointer
K_CLKFREQ: equ 0470h ; system clock frequency
K_MONTH: equ 0475h ; date/time
K_DAY: equ 0476h
K_YEAR: equ 0477h
K_HOUR: equ 0478h
K_MINUTE: equ 0479h
K_SECOND: equ 047ah
K_SECDEN: equ 047bh
K_SECNUM: equ 047dh


3 changes: 0 additions & 3 deletions src/make_cls.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/make_cmd.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/make_input.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/make_nop.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/make_output.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/make_pwd.bat

This file was deleted.

4 changes: 0 additions & 4 deletions src/make_say.bat

This file was deleted.

3 changes: 0 additions & 3 deletions src/make_stack.bat

This file was deleted.

3 changes: 2 additions & 1 deletion src/nop.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; -------------------------------------------------------------------
; Do nothing but return to the Elf/OS
; Copyright 2021 by Gaston Williams
; -------------------------------------------------------------------
; Based on software written by Michael H Riley
; Thanks to the author for making this code available.
Expand Down Expand Up @@ -30,7 +31,7 @@ include kernel.inc

; Build date
date: db 80H+8 ; Month, 80H offset means extended info
db 7 ; Day
db 21 ; Day
dw 2021 ; Year

; Current build number
Expand Down
5 changes: 2 additions & 3 deletions src/output.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
; -------------------------------------------------------------------
; Output data byte to port 4
; Copyright 2021 by Gaston Williams
; -------------------------------------------------------------------
; Based on software written by Michael H Riley
; Thanks to the author for making this code available.
Expand All @@ -12,11 +13,9 @@
; *** without express written permission from the author. ***
; *******************************************************************


include bios.inc
include kernel.inc


; ************************************************************
; This block generates the Execution header
; It occurs 6 bytes before the program start.
Expand All @@ -30,7 +29,7 @@ include kernel.inc
br start ; Jump past build information
; Build date
date: db 80H+8 ; Month, 80H offset means extended info
db 7 ; Day
db 21 ; Day
dw 2021 ; Year

; Current build number
Expand Down
4 changes: 2 additions & 2 deletions src/pwd.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ include kernel.inc

; Build date
date: db 80h+8 ; Month, 80h offset means extended info
db 7 ; Day
dw 2021 ; year = 2021
db 21 ; Day
dw 2021 ; Year

; Current build number
build: dw 4 ; build
Expand Down
13 changes: 6 additions & 7 deletions src/say.asm
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
; *******************************************************************************************
; Say - Write input string to console
;
; Copyright (c) 2021 by Gaston Williams
;
; *******************************************************************************************

include bios.inc
include kernel.inc



; ************************************************************
; This block generates the Execution header
; It occurs 6 bytes before the program start.
Expand All @@ -23,7 +20,7 @@ include kernel.inc

; Build information
binfo: db 80H+8 ; Month, 80H offset means extended info
db 7 ; Day
db 21 ; Day
dw 2021 ; Year

; Current build number
Expand All @@ -48,7 +45,8 @@ start: lda ra ; move past any spaces
plo rf
sep scall ; otherwise display
dw o_msg ; usage message and
sep sret ; return to Elf/OS
;sep sret ; return to Elf/OS
lbr o_wrmboot ; return to Elf/OS
good: ghi ra ; copy RA to RF
phi rf
Expand All @@ -57,7 +55,8 @@ good: ghi ra ; copy RA to RF
sep scall ; display
dw o_msg ; text message and
sep sret ; return to Elf/OS
; sep sret ; return to Elf/OS
lbr o_wrmboot ; return to Elf/OS
usage: db 'Usage: say text',10,13,0
Expand Down
6 changes: 3 additions & 3 deletions src/stack.asm
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ include kernel.inc
br start ; Jump past build information

; Build date
date: db 80H + 8 ; Month (3) 80H offset means extended info
db 7 ; Day (2)
dw 2021 ; Year (2021)
date: db 80H + 8 ; Month 80H offset means extended info
db 21 ; Day
dw 2021 ; Year

; Current build number
build: dw 4
Expand Down
1 change: 1 addition & 0 deletions src/stg/asm.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Your Path]\Asm02\asm02 -b -l -pev2 %1
Loading

0 comments on commit b667050

Please sign in to comment.