scene.org File Archive

File download

<root>­/­parties­/­2022­/­vccc22­/­wild/voidstar_5110_asm_vc3-2022.zip

File size:
1 252 270 bytes (1.19M)
File date:
2022-12-30 11:32:14
Download count:
all-time: 7

Preview

  • VOIDSTAR_5110_ASM_vc3-2022/file_id.diz 5.34K
  • VOIDSTAR_5110_ASM_vc3-2022/program_star.asm 8.43K
  • VOIDSTAR_5110_ASM_vc3-2022/program_star.bin 328B
  • VOIDSTAR_5110_ASM_vc3-2022/result.png 743.84K
  • VOIDSTAR_5110_ASM_vc3-2022/result_emulated.jpg 611.68K
  • VOIDSTAR_5110_ASM_vc3-2022/source.png 84.92K
  • VOIDSTAR_5110_ASM_vc3-2022/source2.png 68.75K

file_id.diz

Centered Christmas Star on IBM 5110

Author: voidstar (v*)
Category: Christmas Challenge (Wild)
System:   IBM 5110
Language: Assembler (Alfred Arnold Macro Assembler 1.42 Beta [Bld 231])
Len source code: 8495 bytes
Len exe file:    328 bytes
Len code only:   328 bytes  (this system has no POKE command; executable loaded using ROS/ROM DCP)
Instructions:
Alfred updated his Macro Assembler to support PALM instructions in Fall 2022.  This "Christmas Star" program 
is the first reference program to use it (in both emulator and real system).  The same code can also
run on an earlier IBM 5100, with three changes (the screen codes used for "*", " "/space, and " " scancode).
However, we still don't have a functional IBM 5100 emulator (we're close!!).  I've updated my 5110VEMU emulator
to have better inline disassembly and to be able to load and run binaries (it has to wait for the Executive ROS 
startup memory test to complete before doing so), as a convenient way to by-pass tape/disk emulation.

The emulator code is located here:   (see "version2" branch for feature that loads AS assembled binaries)
https://github.com/voidstar78/5110VEMU

For a physical IBM 5110, the basic steps are:
- wait for APL or BASIC startup
- press HOLD, then CMD-* to enter DCP, then CMD-+ or CMD-MINUS to enter DIAG DCP mode
- Use "A" (ALTER) command to key in the binary code (0x2000 is good)
- Alternatively, load the program from tape using the "C" command of the built in DCP
- example: "C", "5", then E80 (for tape device) or D80 (for disk device) followed by "RD A 2000 S 2200 F 1" command
- Then ATTN to go back to the DCP menu, and issue "BR 2000" to run the code at 0x2000

For the 5110VEMU, the steps are:
- get example3_star.asm in the same folder as the emulator
- refer to the go3.bat script as an example of assembling the ASM to a .P file, then convert that .p to a raw binary (.bin)
- use the "command_input_ASM_GO2000.txt" command input when loading a .BIN binary, to help pause the emulator at the moment right before the binary is about to be executed (so you can step or add watches, etc.)
- (for now binaries are hard-coded to 2000; this will be adjustable in the future)


Description:
The IBM 5110 has a very limited BIOS.  The only built in routines of the Executive ROS help
facilitate device I/O (tape and disk read/write operations), but no real display-related utilities.
Address 0x0200 of RWS (RAM) is mapped directly to the 64x16 text screen (1024 bytes).  There are no
ROM routines for clearing the screen or scrolling the screen (at least none that I'm aware of).
Even after reviewing the disassembled Executive ROS itself, it has code to manually clear and scroll the
screen as well.

The built in BASIC of this system is based off the BASIC from an IBM System/3.  That system used a
line printer and had no concept of "CLS" to clear the screen.  Also, that version of BASIC did not
have PEEK and POKE commands - it was a branch of BASIC long predating Microsoft.

If you examine the CLEAR SCREEN routine, it clears two characters at a time.  So the approach I chose
for this was to use a similar approach to write pairs of "**" on columns down the screen.  This gets
the bulk of the STAR written to the display.   Then, I just add the extra missing "*" or "**"'s as 
needed down the rows (although the system is byte-addressable, there are some tricks involved in using
the 16-bit registers).

If you play this "slowly" in the emulator, it's interesting to watch it be drawn.  I have a video
prepared on entering this program into the IBM 5110, saving it to disk, and reloading it after a reset.
This was to confirm that Arnold's assembler results do work on the real hardware.

NOTE: The IBM 5110 only has a 64x16 display (like the later TRS-80 systems).  The original Star
was 17x17 text.  I addressed this by removing the center line of the star, making it a 17x16
arrangement.  This still keeps the shape vertically and horizontally symmetric.

NOTE: The program also supports a feature where if the user presses SPACEBAR, it will begin to
draw the star using each symbol in the available character set (making it look like it is flashing
or "twinkling").

Comments:
I've been meaning to try out the PALM support in the Macro Assembler for awhile, this gave a good
excuse to give it a try.   I'm headed to the airport early for winter break, so the night before I 
only had a few hours to draft out the code and try it on the real hardware.   I'm still learning 
PALM machine code, but I know for sure this could have been written in a more compact way, and
use of the internal speaker would be possible to add sound (the IBM 5110 added a speaker 
behind the CRT, a feature not on the IBM 5100).

I do plan to continue adding features to my 5110VEMU project - the next main feature will be
breakpoints at user specified program counter positions.  After that, maybe "watches" for 
specific register values.  But the thing I'd really like to get done is a working IBM 5100
emulator -- we can't determine yet if we're missing a small piece of the ROS (specifically, the
"Common ROS" part) or if we're just misunderstanding a subtle difference in the addressing
schema between the two systems (which otherwise use exactly the same PALM processor).

Thanks for hosting this Challenge!  Happy New Year and Merry Christmas to all. 
voidstar (v*) - December 2022