scene.org File Archive

File download

<root>­/­parties­/­2024­/­vccc24­/­christmas_challenge/spark2k06_pcxt_assembler_100b_vc3-2024.zip

File size:
30 224 bytes (29.52K)
File date:
2024-12-29 14:13:04
Download count:
all-time: 0

Preview

  • file_id.diz 2.77K
  • XMAS2024.asm 750B
  • XMAS2024.COM 100B
  • XMAS2024.png 41.55K

file_id.diz

Xmas2024

Author: Aitor Gómez García (spark2k06)
Category: Christmas Challenge
System:   PCXT
Language: Assembler, TASM 1.0
Len source code: 750 bytes
Len exe file:    100 bytes
Len code only:   100 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 XMAS2024.COM

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

The code begins by setting the text mode to 40x25 color using interrupt 10h with AX set to 1. This establishes a compatible display mode for early graphics cards, similar to the previous example.
Direct Memory Access to Video Memory
The program sets up direct access to video memory by setting the ES register to segment 0B800h, which is the standard location for text mode video memory in DOS.

Drawing the Frame
-----------------

The code draws a frame-like structure on the screen:

Horizontal Lines: It draws three horizontal lines using '-' characters, each 19 characters wide. These lines are positioned at different vertical locations on the screen.
Vertical Lines: Two vertical lines are drawn using '!' characters, forming the sides of the frame. These extend for 19 rows.
Corner Markers: '+' characters are placed at the corners of the frame, enhancing its appearance.

Adding Decorative Elements
--------------------------

After drawing the basic frame, the code adds a decorative element:
A small figure resembling a face or ornament is drawn near the top of the frame. It consists of a backslash '', the letter 'o', and a forward slash '/', creating a simple graphical element.

Color Attributes
----------------

The code uses different color attributes for various parts of the drawing:
The frame is drawn with a color attribute of 4 (likely red in standard CGA color palette).
The decorative element at the top uses a color attribute of 15 (bright white in CGA).

Looping and Positioning
-----------------------

The code uses several loops and careful positioning (manipulating the DI register) to place each element of the drawing at the correct location on the screen.

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

The program ends with interrupt 20h, returning control to DOS.
Overall, this code creates a simple graphical display resembling a decorated frame or possibly a stylized Christmas card layout, using ASCII characters and color attributes in text mode.

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