Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I access ProDOS routines from machine language?

0
Posted

How do I access ProDOS routines from machine language?

0

You use the ProDOS Machine Language Interface (MLI). The MLI is responsible for carrying out nearly all of the functions (Read Block, Write Block, and 24 others) which ProDOS can perform. Machine language programs call ProDOS by doing a JSR to the MLI at $BF00. To determine which function to perform, ProDOS examines the “command” byte immediately following the JSR instruction. Immediately after the command byte come two more bytes that point to the command’s parameter list. When the call completes, it returns to the code immediately following the parameter list pointer. A ProDOS MLI call looks something like this: 20 00 BF JSR MLI 80 Database COMMAND_CODE 50 03 DW PARAM_LIST_LOCATION B0 __ BCS ERROR In the above, the command code ($80) says “Read a block” and the parameter list is located at $0350. The MLI call returns with the carry flag set and an error code in the accumulator if an error occurred; so, a simple error check (the Branch if Carry Set instruction) is often the next instr

0

You use the ProDOS Machine Language Interface (MLI). The MLI is responsible for carrying out nearly all of the functions (Read Block, Write Block, and 24 others) which ProDOS can perform. Machine language programs call ProDOS by doing a JSR to the MLI at $BF00. To determine which function to perform, ProDOS examines the “command” byte immediately following the JSR instruction. Immediately after the command byte come two more bytes that point to the command’s parameter list. When the call completes, it returns to the code immediately following the parameter list pointer. A ProDOS MLI call looks something like this: 20 00 BF JSR MLI 80 DB COMMAND_CODE 50 03 DW PARAM_LIST_LOCATION B0 __ BCS ERROR In the above, the command code ($80) says “Read a block” and the parameter list is located at $0350. The MLI call returns with the carry flag set and an error code in the accumulator if an error occurred; so, a simple error check (the Branch if Carry Set instruction) is often the next instruction

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123