This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Decrements A PSHX Pushes X onto the stack LDAB 0,X Loads initial array element into B INX Increments X again CMPB 0,X Compares B to the next element of the array BLE Branches to next if B is less than or equal to currently selected array location LDAB 0,X Loads the current array value into B if branch not taken next INX Increments X DECA Decrements A BNE again Branch to again if A is not 0 PULX Pulls X from stack if branch is not taken PULA Pulls A from stack RTS Return to point following subroutine call The primary purpose of this subroutine is to locate the largest value in the array and return it upon completion....
View Full Document
- Spring '11