User Tools

Site Tools


blog:pushbx:2025:0119_ms-dos_simpler_buffers_and_doscode_split

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

blog:pushbx:2025:0119_ms-dos_simpler_buffers_and_doscode_split [2025-01-19 19:20:01 +0100 Jan Sun]
ecm created
blog:pushbx:2025:0119_ms-dos_simpler_buffers_and_doscode_split [2026-06-01 20:03:02 +0200 Jun Mon] (current)
ecm [lmacros] typo
Line 21: Line 21:
 [[https://hg.pushbx.org/ecm/lmacros/rev/de2571144d60|Pick a change]] first done on lmacros2.mac [[https://hg.pushbx.org/ecm/msdos4/rev/8627b39be333|in the lMS-DOS repo]]. Allow the use of ''lframe -2'' (in 16-bit code) to enable using the macros without pushing the BP register to the expected spot. [[https://hg.pushbx.org/ecm/lmacros/rev/de2571144d60|Pick a change]] first done on lmacros2.mac [[https://hg.pushbx.org/ecm/msdos4/rev/8627b39be333|in the lMS-DOS repo]]. Allow the use of ''lframe -2'' (in 16-bit code) to enable using the macros without pushing the BP register to the expected spot.
  
-This is used in lMS-DOS's function ''restore_world'' which has the final output BP within its stack frame so we do not want to additionally push the input BP. [[https://hg.pushbx.org/ecm/msdos4/rev/e454c8d595bd#l1.27|This is achieved]] by combining ''lframe -2'' with several ''lpar'' uses, and an ''lemit off'' followed by ''lenter''. After the non-emittng ''lenter'' we place a manual ''mov bp, sp'' which sets up the Base Pointer register to the right offset to allow access to the declared parameters. As is usual for more complex stack frames we clean up with an ''lleave ctx'' mmacro call.+This is used in lMS-DOS's function ''restore_world'' which has the final output BP within its stack frame so we do not want to additionally push the input BP. [[https://hg.pushbx.org/ecm/msdos4/rev/e454c8d595bd#l1.27|This is achieved]] by combining ''lframe -2'' with several ''lpar'' uses, and an ''lemit off'' followed by ''lenter''. After the non-emitting ''lenter'' we place a manual ''mov bp, sp'' which sets up the Base Pointer register to the right offset to allow access to the declared parameters. As is usual for more complex stack frames we clean up with an ''lleave ctx'' mmacro call.
  
  
blog/pushbx/2025/0119_ms-dos_simpler_buffers_and_doscode_split.txt ยท Last modified: 2026-06-01 20:03:02 +0200 Jun Mon by ecm