scene.org File Archive

File download

<root>­/­parties­/­2023­/­vccc23­/­christmas-diamonds/spark2k06_pcxt_assembler_vc3-2023.zip

File size:
31 704 bytes (30.96K)
File date:
2024-01-03 14:15:18
Download count:
all-time: 10

Preview

  • file_id.diz 2.46K
  • RESULT.PNG 10.00K
  • SOURCE.PNG 23.24K
  • XMAS2023.ASM 612B
  • XMAS2023.COM 76B

file_id.diz

Xmas2023

Author: Aitor Gómez García (spark2k06)
Category: Christmas Challenge
System:   PCXT
Language: Assembler, TASM 1.0
Len source code: 612 bytes
Len exe file:    76 bytes
Len code only:   76 bytes
Instructions:
You can use PCEm as an emulator, or even simpler DosBox to run it comfortably. 

1. Install DosBox from the official website: https://sourceforge.net/projects/dosbox/
2. Save the demo to a folder (for example C:\Demo), run DosBox, mount the folder on a drive, like C: mount C C:\Demo
3. Go to the folder with the instructions C:\Demo, cd Demo, and run the demo with XMAS2023.COM

Description:

Setting the Text Mode
---------------------

The code begins by setting the text mode to 40x25 color, which is compatible with early graphics cards like CGA (Color Graphics Adapter). This is done through interrupt 10h with AX set to 0001h. This mode is commonly used for text displays in DOS and is compatible with the hardware limitations of early personal computers.

Direct Memory Access to Video Memory
------------------------------------

The code sets up direct access to the video memory, which starts at segment 0B800h for text mode. The ES register is set to this segment, and DI is initialized to an offset value, targeting a specific location on the screen.

Data and Loop Setup
-------------------

A loop is established to process a series of bytes defined in the 'data' section. These bytes represent the pattern to be drawn on the screen. CX is set to 7, indicating the count of bytes to be processed, and BX is set with a color attribute for the asterisks.

Drawing the Pattern
-------------------

Each byte in the 'data' section is processed in a loop. For each bit in a byte, the code checks if it's 1 (using the test instruction). If it's 1, an asterisk is drawn at the current position. The DI register is used to navigate through the video memory, arranging the asterisks in a Christmas-themed shape.

Memory Copying
--------------

After drawing the pattern, the program copies a section of the memory to another location. This might be to replicate the drawn pattern across the screen or move it to a specific location. The rep movsb instruction facilitates this memory copy.

Termination
-----------

The program ends with interrupt 20h, returning control to DOS.

Comments:
Develop & debug with TASM 1.0, PCEm and DEBUG.COM

Go to my website for additional information about me and my personal projects
https://aitorgomez.net