while.asl 450 B

1234567891011121314151617181920212223242526
  1. // TODO: when implemented, the `+= 1`s can be turned into `++` - this requires DefIncrement
  2. DefinitionBlock("while.aml", "DSDT", 1, "RSACPI", "WHILE", 1) {
  3. Name(X, 0)
  4. While (X < 5) {
  5. X += 1
  6. }
  7. // Test `DefBreak` - Y should only make it to 5
  8. Name(Y, 0)
  9. While (Y < 10) {
  10. If (Y >= 5) {
  11. Break
  12. }
  13. Y += 1
  14. }
  15. // Test `DefContinue` - Z should remain at zero
  16. Name(CNT, 0)
  17. Name(Z, 0)
  18. While (CNT < 5) {
  19. CNT += 1
  20. Continue
  21. Z += 1
  22. }
  23. }