.TITLE Payroll ;Payroll program from Section 3.2, page 96 ;Calculate Pay given Hours and PayRate. Use time and ; a half for any hours beyond 40 NormalHours = ^F40 Half = ^F0.5 Hours: .FLOAT 42.0 ;Assign value for Hours PayRate: .FLOAT 9.5 ;Assign hourly pay rate Pay: .BLKF 1 ;Reserve room for pay earned .ENTRY CalculatePay, 0 ; *******Determine if emplyee worked overtime******* Begin: CMPF Hours,#NormalHours ;IfHours>40 BGTR Overtime ;brance to Overtime ; *******Calculate normal pay******* MULF3 PayRate,Hours,Pay BRB Done ; Skip over alternative calculations ; *******Calculate pay if ther is overtime******* Overtime: SUBF3 #NormalHours,Hours,R3 ;R3 get overtime hours MULF2 #Half,R3 ;R3 gets adjusted overtime ; hours ADDF2 Hours,R3 ;R3 gets adjusted total hours MULf3 PayRate,R3,Pay Done: $EXIT_S .END CalculatePay