🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4365

Re: Writing assembly procedures for higher level languages

#4365
From: Jeff Pipkins Dev hou
Date: Fri, 25 Jan 1991 15:02
24 lines
1663 bytes
In article <1991Jan24.133054.8715@wpi.WPI.EDU> jhall@wpi.WPI.EDU (John Clinton Hall) writes:
>
>AccordingtMicrosoft's _Mixed-Language Programming Guide_, "A procedure
>caled from any of the Microsoft high-level languages should preserve the
>values of SI, DI, SS, and DS (in additon to BP, which is already saved)." 
>However, does one need to save the ES register if it is mdified?  How abo
>the flags register?

No, you don't have to save ES if it doesn't say that you have to save ES.
As for the flags, all of the code the compiler generates assumes that
the direction flag is 0 (CLD), and of course, interrupts should be enabled
(STI).  You don't want the single-step flag on either.  But the arithmetic
flags don't have to be saved (zero, carry, etc.).  If you modify BP you
will have to restore it before returning if you use the standard sequence.
The last thing your function does before returning is LEAVE (= mov sp, bp;
pop bp).

Good luck.

-- 
Jeff D. Pipkins (uunet!cpqhou!pipkinsj)

My disclaimer: My opinions do not necessarily reflect those of my employer.
Papaw's disclaimer: I've already told you more than I know.
Technical Details
Message-ID: <1991Jan25.150224.12525@cpqhou.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cpqhou!pipkinsj
References: <1991Jan24.133054.8715@wpi.WPI.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cpqhou!pipkinsj
From: pipkinsj@cpqhou.uucp (Jeff Pipkins @Adv Dev@SE hou )
Newsgroups: comp.os.msdos.programmer
Subject: Re: Writing assembly procedures for higher level languages
Message-ID: <1991Jan25.150224.12525@cpqhou.uucp>
Date: 25 Jan 91 15:02:24 GMT
References: <1991Jan24.133054.8715@wpi.WPI.EDU>
Reply-To: pipkinsj@cpqhou.UUCP (Jeff Pipkins @Adv Dev@SE hou )
Organization: Compaq Computer Corporation
Lines: 24